package xworker.gluon.glisten.mvc;


import com.gluonhq.charm.glisten.control.AppBar;
import com.gluonhq.charm.glisten.mvc.View;
import org.xmeta.ActionContext;
import org.xmeta.Thing;

public class ThingView extends View {
    Thing thing;
    ActionContext actionContext;

    public ThingView(Thing thing, ActionContext actionContext){
        this.thing = thing;
        this.actionContext = actionContext;
    }

    @Override
    protected void updateAppBar(AppBar appBar) {
        super.updateAppBar(appBar);

        Thing appBarThing = thing.getThing("AppBar@0");
        System.out.println("ThingView: init app bar, appBar=" + appBarThing);
        if(appBarThing != null){
            appBarThing.doAction("init", actionContext, "appBar", appBar);
        }
    }
}
